package com.whminwei.edu.api.school.client;

import com.whminwei.common.feign.decoder.FullHttpRspnConfig;
import com.whminwei.common.http.rspn.FullHttpResponse;
import com.whminwei.common.http.rspn.SimpleListRspn;
import com.whminwei.edu.api.school.dto.feq.GetSchYearTermFeq;
import com.whminwei.edu.api.school.dto.feq.GetSpecSchTermFeq;
import com.whminwei.edu.api.school.dto.fspn.GetPreWeekFspn;
import com.whminwei.edu.api.school.dto.fspn.GetSchoolTermFspn;
import com.whminwei.edu.api.school.dto.fspn.GetSchoolYearFspn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zhangjq
 * @since 2024-04-07
 */
@FeignClient(name = "xzzg-pt-school-service", contextId = "school-term-info", configuration = FullHttpRspnConfig.class)
public interface SchoolTermClient {

    /**
     * 查询学期
     *
     * @param req 查询参数，偏移量为0表示本学期，-1表示上学期，1表示下学期，以此类推
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.school.dto.fspn.GetSchoolTermFspn>
     * @author zhangjq
     * @since 2024-04-22
     */
    @PostMapping("/school_term/get_term")
    FullHttpResponse<GetSchoolTermFspn> getSchoolTerm(@RequestBody GetSchYearTermFeq req);

    /**
     * 查询学年
     *
     * @param req 查询参数，偏移量为0表示本学年，-1表示上学年，1表示下学年，以此类推
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.school.dto.fspn.GetSchoolYearFspn>
     * @author zhangjq
     * @since 2024-04-22
     */
    @PostMapping("/school_term/get_year")
    FullHttpResponse<GetSchoolYearFspn> getSchoolYear(@RequestBody GetSchYearTermFeq req);

    /**
     * 依据学年与学期序号查询学期
     *
     * @param req 查询参数
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.school.dto.fspn.GetSchoolTermFspn>
     * @author zhangjq
     * @since 2024-04-22
     */
    @PostMapping("/school_term/get_spec_term")
    FullHttpResponse<GetSchoolTermFspn> getSpecSchTerm(@RequestBody GetSpecSchTermFeq req);

    /**
     * 依据学年查询学期列表
     *
     * @param req 查询参数
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.common.http.rspn.SimpleListRspn < com.whminwei.edu.api.school.dto.fspn.GetSchoolTermFspn>>
     * @author zhangjq
     * @since 2024-04-22
     */
    @PostMapping("/school_term/get_all_term")
    FullHttpResponse<SimpleListRspn<GetSchoolTermFspn>> getAllSchTerm(@RequestBody GetSpecSchTermFeq req);

    /**
     * 查询所有学期列表
     *
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.common.http.rspn.SimpleListRspn < com.whminwei.edu.api.school.dto.fspn.GetSchoolTermFspn>>
     * @author zhangjq
     * @since 2024-04-22
     */
    @PostMapping("/school_term/get_all_terms")
    FullHttpResponse<SimpleListRspn<GetSchoolTermFspn>> getAllSchTerms();

    /**
     * 查询教学准备周
     *
     * @param req 查询参数，偏移量为0表示本学期，-1表示上学期，1表示下学期，以此类推
     * @return com.whminwei.common.http.rspn.FullHttpResponse<com.whminwei.edu.api.school.dto.fspn.GetPreWeekFspn>
     * @author zhangjq
     * @since 2024-05-27
     */
    @PostMapping("/school_term/get_per_week")
    FullHttpResponse<GetPreWeekFspn> getPreWeek(@RequestBody GetSchYearTermFeq req);
}
